Release 10.1A: OpenEdge Development:
Debugging and Troubleshooting


Event stack

An external event can result in more than one internal event. For example, clicking the mouse in a fill-in might shift the focus from another field, causing ENTRY and LEAVE events, respectively. Since the ordering of events is significant, OpenEdge builds a stack based on events as they occur, starting with the first event at the bottom of the stack. Each succeeding event is added to the stack.

The stack is a LIFO (Last In First Out) stack, which means OpenEdge pushes events onto the stack in the reverse order of their firing. In the focus example above, clicking in the fill-in causes the focus to shift, so the ENTRY event is first in the stack.

In some cases, a trigger on one event takes precedence over a trigger on another event. For example, when you click the mouse to choose a button, OpenEdge generates both a MOUSE-SELECT-CLICK event and a CHOOSE event for the button (among other possible events). Since the MOUSE-SELECT-CLICK trigger takes precedence over the CHOOSE trigger for a button, OpenEdge recognizes that the CHOOSE trigger should not fire and does not push it onto the stack.

Sometimes OpenEdge has to insert an event elsewhere in the stack than at the top. For example, when you click the mouse to choose a button, OpenEdge pushes the MOUSE-SELECT-DOWN and ENTRY events that are the first to occur, onto the stack. When you release the mouse button, a CHOOSE event occurs, but if OpenEdge pushes the CHOOSE event onto the top of the stack, a CHOOSE trigger on the button will fire before an ENTRY trigger. Since an ENTRY trigger always must fire before a CHOOSE trigger, OpenEdge inserts the CHOOSE event below the ENTRY event so the CHOOSE trigger will fire after the ENTRY trigger.

Once it adds the events for an external action to the stack, OpenEdge starts to remove events. Since the stack is built in reverse order, the last event pushed onto the stack is the first to be removed. As it removes each event, OpenEdge checks for triggers and runs the 4GL code for each event trigger it finds.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095